package io.gitee.wminyu.day03;

import java.util.Arrays;

public class array_of_practice1 {
    public static void main(String[] args){
        int[][] scores = {
                {11, 12, 13, 14},
                {21, 22, 23, 24},
                {31, 32, 33, 34}
        };
      Display1(scores);
      System.out.println("\n");
      Dispaly2(scores);
      System.out.println("\n");
      Display3(scores);
      System.out.println("\n");
      Display4(scores);
      System.out.println("\n");
      Display5(scores);
    }

    //打印数组（从左到右，从上到下）：
    public static void Display1(int[][] numble){
        for (int i=0;i<3;i++){
            for (int j =0;j<4;j++){
                System.out.print(numble[i][j]+" ");
            }System.out.println();

        }
    }

    //从下往上打印数组（左右顺序不变）
    public static void Dispaly2(int[][] numble){
        for (int i=3-1;i>-1;i--){
            for (int j =0;j<4;j++){
                System.out.print(numble[i][j]+" ");
            } System.out.println();
        }
    }

    //从下往上，从右往左打印数组
    public static void Display3(int[][] numble){
        for (int i=3-1;i>-1;i--){
            for (int j =4-1;j>-1;j--){
                System.out.print(numble[i][j]+" ");
            }System.out.println();
        }
    }

    //数组顺时针转90°打印。
    public static void Display4(int[][] numble){
        int i,j;
        for (j = 0; j<4; j++){
            for ( i = 3-1;i>-1; i--) {
                System.out.print(numble[i][j] + " ");
            }
                System.out.println();
        }
    }

    //数组逆时针转90°打印。
    public static void Display5(int[][] numble){
        for (int j=4-1;j>-1;j--){
            for (int i=0;i<3;i++){
                System.out.print(numble[i][j]+" ");
            }
           System.out.println();
        }
    }
}
